﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class news_newsdetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string  id=Request.QueryString["id"];
            DataSet_fp_news_DyhTableAdapters.Dyh_NewsTableAdapter newsTable = new DataSet_fp_news_DyhTableAdapters.Dyh_NewsTableAdapter();
            if (newsTable.Get_Pre_Data_By_Id(Convert.ToInt32(id.ToString())).Rows.Count > 0)
            {
                HyperLink_Pre.Text ="<<  "+ newsTable.Get_Pre_Data_By_Id(Convert.ToInt32(id.ToString())).Rows[0]["title"].ToString()+"  ";
                HyperLink_Pre.NavigateUrl = "newsdetail.aspx?id=" + newsTable.Get_Pre_Data_By_Id(Convert.ToInt32(id.ToString())).Rows[0]["id"].ToString();
                HyperLink_Pre.Visible = true;
            }
            else
            {
                HyperLink_Pre.Visible = false;
            }

            
            
            if (newsTable.Get_Next_Data_By_Id(Convert.ToInt32(id.ToString())).Rows.Count > 0)
            {
                HyperLink_Next.Text ="  "+ newsTable.Get_Next_Data_By_Id(Convert.ToInt32(id.ToString())).Rows[0]["title"].ToString()+"  >>";
                HyperLink_Next.NavigateUrl = "newsdetail.aspx?id=" + newsTable.Get_Next_Data_By_Id(Convert.ToInt32(id.ToString())).Rows[0]["id"].ToString();
                HyperLink_Next.Visible = true;
            }
            else
            {
                HyperLink_Next.Visible = false;
            }
        }
    }
}
